
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace EVegetable.Persistence.Test.DataManager
{
    public class TSys_AppMenuManager : BaseManager
    {
        #region private field

        private static TSys_AppMenuManager manager;
        #endregion

        #region Properties
        
        public Int32 MenuID
        {
            get { return GetConfig<Int32>("MenuID"); }
            set { SetConfig<Int32>("MenuID", value); }
        }
        
        public Int32? PMenuID
        {
            get { return GetConfig<Int32?>("PMenuID"); }
            set { SetConfig<Int32?>("PMenuID", value); }
        }
        
        public String MenuCode
        {
            get { return GetConfig<String>("MenuCode"); }
            set { SetConfig<String>("MenuCode", value); }
        }
        
        public String MenuName
        {
            get { return GetConfig<String>("MenuName"); }
            set { SetConfig<String>("MenuName", value); }
        }
        
        public Int32 MenuLevel
        {
            get { return GetConfig<Int32>("MenuLevel"); }
            set { SetConfig<Int32>("MenuLevel", value); }
        }
        
        public Int32 Sort
        {
            get { return GetConfig<Int32>("Sort"); }
            set { SetConfig<Int32>("Sort", value); }
        }
        
        public String Hint
        {
            get { return GetConfig<String>("Hint"); }
            set { SetConfig<String>("Hint", value); }
        }
        
        public String Icon
        {
            get { return GetConfig<String>("Icon"); }
            set { SetConfig<String>("Icon", value); }
        }
        
        public String LinkURL
        {
            get { return GetConfig<String>("LinkURL"); }
            set { SetConfig<String>("LinkURL", value); }
        }
        
        public String Target
        {
            get { return GetConfig<String>("Target"); }
            set { SetConfig<String>("Target", value); }
        }
        
        public String Description
        {
            get { return GetConfig<String>("Description"); }
            set { SetConfig<String>("Description", value); }
        }
        
        public Int32 Creator
        {
            get { return GetConfig<Int32>("Creator"); }
            set { SetConfig<Int32>("Creator", value); }
        }
        
        public DateTime CreatedDate
        {
            get { return GetConfig<DateTime>("CreatedDate"); }
            set { SetConfig<DateTime>("CreatedDate", value); }
        }
        
        public Int32? Modifier
        {
            get { return GetConfig<Int32?>("Modifier"); }
            set { SetConfig<Int32?>("Modifier", value); }
        }
        
        public DateTime ModifiedDate
        {
            get { return GetConfig<DateTime>("ModifiedDate"); }
            set { SetConfig<DateTime>("ModifiedDate", value); }
        }
        
        public Boolean Active
        {
            get { return GetConfig<Boolean>("Active"); }
            set { SetConfig<Boolean>("Active", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TSys_AppMenuManager
        /// </summary>
        private TSys_AppMenuManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TSYS_APPMENU_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TSYS_APPMENU_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TSys_AppMenuManager Instance

        /// <summary>
        /// TSys_AppMenuManager's Instance
        /// </summary>
        public static TSys_AppMenuManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TSys_AppMenuManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
